#region Using

using System;
using BlogEngine.Core.StorageProviders;

#endregion

namespace BlogEngine.Core
{
    /// <summary>
    /// An asset is something that is used within the blog - like photos, videos, files, etc.
    /// </summary>
    [Serializable]
    public abstract class MediaBase<T> : RelateableBase<T> where T : MediaBase<T>, new()
    {

        #region Constructor

        /// <summary>
        /// Protected Default Constructor
        /// </summary>
        protected MediaBase() :base()
        {
        }

        /// <summary>
        /// The default contstructor assign default values.
        /// </summary>
        public MediaBase(MediaType mediaType) :base()
        {
            _MediaType = mediaType;
//            _Provider = StorageManager.GetProvider(mediaType, serviceType);
        }

        #endregion

  
        #region Properties

        private MediaType _MediaType;

        /// <summary>
        /// Type of Media file
        /// </summary>
        protected MediaType MediaType 
        {
            get { return _MediaType; }
        }


        private string _ServiceType;

        /// <summary>
        /// Type of Media file
        /// </summary>
        protected string ServiceType
        {
            get { return _ServiceType; }
        }

        protected StorageProvider Provider
        {
            get { return StorageProviderService.PhotoProvider; }
        }

        private string _Location;
        /// <summary>
        /// Gets or sets the Location or the photo.
        /// </summary>
        public string Location
        {
            get { return _Location; }
            set
            {
                if (_Location != value) MarkChanged("Location");
                _Location = value;
            }
        }

        private string _OriginalFileName;
        /// <summary>
        /// Gets or sets the original file name of the Photo.
        /// </summary>
        public string OriginalFileName
        {
            get
            {
                return _OriginalFileName;
            }
            set { _OriginalFileName = value; }
        }

        #endregion
    }
}

